package demo.app.nexd.com.demo;

import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.OvalShape;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;

public class MainActivity extends AppCompatActivity {

    private ImageView car;
    private ImageView taobao;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        car = (ImageView) findViewById(R.id.car);
        taobao = (ImageView) findViewById(R.id.taobao);

        ShapeDrawable drawable = new ShapeDrawable(new OvalShape());
        drawable.getPaint().setColor(Color.parseColor("#80e099"));
        car.setBackgroundDrawable(drawable);
        car.setImageResource(R.drawable.che);


        ShapeDrawable drawable2 = new ShapeDrawable(new OvalShape());
        drawable2.getPaint().setColor(Color.parseColor("#d08080"));
        taobao.setBackgroundDrawable(drawable2);
        taobao.setImageResource(R.drawable.taobao);
    }

    public void searchCar(View view) {
        startActivity(new Intent(this, SearchCarActivity.class));
    }

    public void shopping(View view) {
        startActivity(new Intent(this, ShoppingListActivity.class));
    }
}
